#include<stdio.h>
int main(void)
{
	int m,n,k,a,b,i,j,l,d;
	int t=1;
	int c=1;
	int sum;
	scanf("%d%d%d",&m,&n,&k);

	if (k>n)
	printf("Input Error");
	else
	{
		if(m<=k)
		{
			int e=n-m+1;
			for(i=e;i<=n;i++)
				t=t*i;
			printf("%d",t);
		}
		else
		{
		  a=m%k;
		  for (i=1;i<=a;i++)
		  {
		    	t=t*i;
		  }
		  for (j=n;j>0;j--)
		  {
		    	c=c*j;
		  }
		
		sum=c;
		printf("%d",sum);
	    }
	
	}
	return 0;
}
